{% extends "base.html" %}

{% block title %}任务汇总报表 - 在线跑批系统{% endblock %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h1>任务汇总报表</h1>
    <a href="{% url 'dashboard' %}" class="btn btn-secondary">
        <i class="fas fa-arrow-left me-1"></i>返回仪表盘
    </a>
</div>

<div class="row mb-4">
    <div class="col-md-6">
        <div class="card h-100">
            <div class="card-header">
                <h5 class="card-title mb-0">任务状态分布</h5>
            </div>
            <div class="card-body">
                {% if status_chart %}
                    {{ status_chart|safe }}
                {% else %}
                    <p class="text-center text-muted">暂无数据</p>
                {% endif %}
                
                <div class="mt-4">
                    <h6>状态统计详情：</h6>
                    <ul class="list-group">
                        {% for item in status_data %}
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                {{ item.status }}
                                <span class="badge bg-primary rounded-pill">{{ item.count }}</span>
                            </li>
                        {% empty %}
                            <li class="list-group-item text-center text-muted">暂无数据</li>
                        {% endfor %}
                    </ul>
                </div>
            </div>